<template>
	<div class="wrap">
        <transition name="popup">
            <div class="popup" v-show="isPopup">
                <button type="button" class="popup-close" @click="isPopup = !isPopup">关闭</button>
                <div class="popup-main">
                    <div class="search">
                        <div class="search-main">
                            <input class="search-input" type="text" name="keyword" placeholder="输入动物 / 植物 / 动物分类 / 植物分类关键词">
                            <button class="search-button">搜索</button>
                        </div>
                    </div>
                    <div class="result">
                    </div>
                </div>
            </div>
        </transition>
        <div class="search">
            <div class="search-main">
                <input class="search-input" type="text" name="keyword" placeholder="输入动物 / 植物 / 动物分类 / 植物分类关键词">
                <button class="search-button" @click="isPopup = !isPopup">搜索</button>
            </div>
        </div>
	</div>
</template>
<script>
export default {
	name: 'comps-search',
	components: {

	},
    data: function() {
        return {
            isPopup: false
        }
    }
}
</script>
<style scoped>
.popup {
    position: fixed;
    z-index: 15;
    left: 0;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 80px 0 0 0;
    width: 100vw;
    height: 100vh;
    background: rgba(246, 246, 246, 0.8);
    backdrop-filter: blur(5px);
}

.popup-enter-active {
    transition: opacity 0.3s 0.2s, transform 0.5s;
}

.popup-leave-active {
    transition: opacity 0.3s;
}

.popup-enter {
    opacity: 0;
    transform: translateY(600px);
}

.popup-leave-to {
    opacity: 0;
}

.popup-close {
    position: fixed;
    right: 40px;
    top: 20px;
    color: #343434;
    font-size: 24px;
    font-weight: bold;
}

.popup-main {
    width: 1000px;
    height: 100%;
}

.search {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.search-main {
    overflow: hidden;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    width: 100%;
    height: 60px;
    border-radius: 30px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1);
}

.search-input {
    padding: 0 0 0 20px;
    width: 100%;
    height: 100%;
    font-size: 20px;
    background: white;
    border: none;
    outline: none;
}

.search-button {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100px;
    height: 100%;
    color: darkgreen;
    font-size: 20px;
    font-weight: bold;
    background: linear-gradient(180deg, lightgreen, green);
    border-radius: 0 30px 30px 0;
    transition: all 0.3s;
}

.search-button:hover {
    cursor: pointer;
    box-shadow: 0 0 14px 0 rgba(0, 0, 0, 0.3) inset;
}
</style>